
#include <librally.h>
#include <thread.h>

Err rp_rpointd_thread_init()
{
	Err err;

	err = rp_rpointd_thread_hb_init();
	err = rp_rpointd_thread_io_init();
}

Err rp_rpointd_thread_hb_init()
{
	Err err;

	err = rp_thread_create(rp_rpointd_thread_hb_run);
}

Err rp_rpointd_thread_io_init()
{
	Err err;

	err = rp_thread_create(rp_rpointd_thread_io_run);
}

//=========================================

Err rp_rpointd_thread_hb_run()
{
	// TODO:
	/*	(1) Setup TCP connetion with rindexd
		(2) Send heart-beat signal to rindexd
			the signal includes rpointd's local file report
		(3) Do we need to send special message on the first startup?
	*/
	
}

Err rp_rpointd_thread_io_run()
{
	// TODO:
	/*
		(1) setup event facility to listen to incoming connection request
		(2) once accepted a request, we fork a child rpointd to handle the IO operation		
	*/
	
}


